import axios from "axios";
import { getToken } from '../util/cookie'
const server = axios.create({
    baseURL: '',
    timeout: 5000
})

//请求拦截 添加请求头
server.interceptors.request.use(config => {
    //请求头给后端程序员的
    config.headers['my-token'] = getToken('token')
    return config

})

server.interceptors.response.use(res => {
    return res.data
})
export default server;
